//// I have added this to the file/
//also this
//now I am adding this
#include <avr/io.h>
#include "usart.h"

//*****************************************************************************
void transmitString1(unsigned char* string)
{
    while (*string)
		transmitByte1(*string++);
}
//*****************************************************************************


//*****************************************************************************
void transmitString(unsigned char* string)
{
    while (*string)
		transmitByte0(*string++);
}
//*****************************************************************************
void transmitByte0( unsigned char value1)
{
	while ( !(UCSR0A & (1<<UDRE0)) ); 			                /* Wait for empty transmit buffer */
	UDR0 = value1; 			        /* Start transmition */
}
//*****************************************************************************
//*****************************************************************************
void transmitByte1( unsigned char value2)
{
	while ( !(UCSR1A & (1<<UDRE1)) ); 
				                /* Wait for empty transmit buffer */
	UDR1 = value2; 			        /* Start transmition */
}
//*****************************************************************************
void USART_Init()

{
 DDRG = 0xff;
PORTG = 0x00;
	//Set baud rate USART0 at 4800 and USART1 at 4800
        UBRR0H = 0; //high byte
	UBRR0L = 95;		//low byte
	UBRR1H = 0; //high byte
	UBRR1L = 95;	



	//Set data frame format: asynchronous mode,no parity, 1 stop bit, 8 bit size

	UCSR0C=(0<<UMSEL01)|(0<<UMSEL00)|(0<<UPM01)|(0<<UPM00)|

		(0<<USBS0)|(0<<UCSZ02)|(1<<UCSZ01)|(1<<UCSZ00);	

	UCSR1C=(0<<UMSEL11)|(0<<UMSEL10)|(0<<UPM11)|(0<<UPM10)|

		(0<<USBS1)|(0<<UCSZ12)|(1<<UCSZ11)|(1<<UCSZ10);		

	//Enable Transmitter and Receiver and Interrupt on transmit complete

	UCSR0B=(1<<RXEN0)|(1<<TXEN0)|(1<<RXCIE0);
	UCSR1B=(1<<RXEN1)|(1<<TXEN1)|(1<<RXCIE1);

	//enable global interrupts

	//sei();

}
//*******************************************************************************
